package ink.kangaroo.mybatisflexdemo

import com.mybatisflex.kotlin.extensions.db.all
import com.mybatisflex.kotlin.extensions.db.queryOne
import com.mybatisflex.kotlin.extensions.kproperty.eq
import com.mybatisflex.kotlin.extensions.wrapper.from
import com.mybatisflex.kotlin.extensions.wrapper.whereWith
import ink.kangaroo.mybatisflexdemo.entity.User
import org.junit.jupiter.api.Test
import org.springframework.boot.test.context.SpringBootTest

@SpringBootTest
class MybatisFlexDemoApplicationTests {

    @Test
    fun contextLoads() {
        val aqll = queryOne<User> {
            from(User::class)
            whereWith {
                User::id eq 1
            }
        }
        val all = all<User>()
        for (user in all) {
            println(user)
        }
    }

}
